﻿using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.DB.Plumbing;
using YJKOpeningCommon.DbOpening;

namespace YJKOpeningDesignInput.GetData
{
	internal class GetOpeningData
	{
		public GetOpeningData(List<Document> lstDocument, LinkedList<DbOpeningBase> lstOpening)
		{
		}

		private static void GetAllBeam()
		{
		}

		private static void GetAllCableTray()
		{
		}

		private static void GetAllDuct()
		{
		}

		private static void GetAllFloor()
		{
		}

		private static void GetAllPipe()
		{
		}

		private List<T> GetAllIntersectSubject<T>(Element mepElem, Autodesk.Revit.DB.Document doc, BuiltInCategory builtIncategory) where T : Element
		{
			FilteredElementCollector filteredElementCollector = new FilteredElementCollector(doc);
			filteredElementCollector.OfCategory(builtIncategory).WhereElementIsNotElementType();
			ElementIntersectsElementFilter elementIntersectsElementFilter = new ElementIntersectsElementFilter(mepElem);
			filteredElementCollector.WherePasses(elementIntersectsElementFilter);
			return filteredElementCollector.Cast<T>().ToList<T>();
		}

		private bool GetAllSubjectByT<T>(ref List<Element> lstElem, T t, int whichList)
		{
			return true;
		}

		public void GetOpeningDataByDuct<T>(ref List<Duct> lstDuct)
		{
			new List<FamilyInstance>();
		}

		private bool GetAllSubject<T>(ref List<Element> lstElem, T t, int whichList)
		{
			bool result;
			try
			{
				foreach (Autodesk.Revit.DB.Document doc in this.m_lstDoc)
				{
					foreach (CableTray mepElem in this.m_lstcableTray)
					{
						lstElem.AddRange(this.GetAllIntersectSubject<FamilyInstance>(mepElem, doc, BuiltInCategory.OST_StructuralFraming));
					}
				}
				result = true;
			}
			catch (Exception)
			{
				result = false;
			}
			return result;
		}

		private static void GetEquipFloorOpeningData()
		{
		}

		private void GetEquipWallOpeningData()
		{
		}

		private void GetFloorOpeningData()
		{
		}

		private void GetWallOpeningData()
		{
		}

		private void GetOpening<T>(List<T> lstSubject, List<T> lstCut, int whichGroup) where T : Element
		{
		}

		private void InitData()
		{
		}

		private void setOpeningProperty<T>(T openingIns)
		{
		}

		private List<FamilyInstance> m_lstBeam;

		private List<CableTray> m_lstcableTray;

		private List<Duct> m_lstDuct;

		private List<FamilyInstance> m_lstEquip;

		private List<Floor> m_lstFloor;

		private List<Pipe> m_lstHVACPipe;

		private LinkedList<DbOpeningBase> m_lstOpening;

		private List<Wall> m_lstWall;

		private List<Pipe> m_lstWaterPipe;

		private List<Document> m_lstDoc;
	}
}
